<include file="Public:top" /> 
<style>
input{margin-bottom:10p;}
tr{ height:28px;}
</style>
<script>
var editor;
</script>
<div id="main" class="" >
<div class="content">
<div class="title">{$vo.sName}单位食堂信息管理  [ <a href="__URL__">返回列表</a> ]</div>
<form method="post" id="form2" name="form2">
<table width="90%" cellpadding=3 cellspacing=3>
<tr>
	<td width="140" class="tRight" >学生人数：</td>
	<td width="220" class="tLeft" >{$vo.sStudentCount}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="tRight">教职工数：{$vo.sStaffCount}</span></td>
    <td width="110" class="tLeft"></td>
    
    <td width="113" class="tRight" >厨房消防：</td>
	<td width="189" class="tLeft" >{$vo.cfxf|getAqInfo='cfxf',1}</td>
    <td width="89" class="tLeft">[<a href="#" id="a_cfxf_d" f="cfxf_d" s="厨房消防详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >经营单位：</td>
  <td class="tLeft" ><input type="text" class="medium bLeft"  name="jydw" value="{$vo.jydw}" /></td>
  <td class="tLeft">[<a href="#" id="a_jydw_d" f="jydw_d" s="经营单位详细情况">详细</a>]</td>
	<td class="tRight" >燃料方式：</td>
	<td class="tLeft" ><SELECT class="medium bLeft"  name="rlfs">
    <option  value=""></option>
	<option <eq name="vo.rlfs" value="汽" >selected</eq> value="汽">汽</option>
	<option <eq name="vo.rlfs" value="油" >selected</eq> value="油">油</option>
    <option <eq name="vo.rlfs" value="其他" >selected</eq> value="其他">其他</option>
	</SELECT></td>
    <td class="tLeft">[<a href="#" id="a_rlfs_d" f="rlfs_d" s="燃料使用方式详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >合同期限：</td>
  <td colspan="2" class="tLeft" ><input type="text" id="htqx" name="htqx" class="easyui-datebox medium bLeft" value="{$vo.htqx|toDate='Y-m-d'}" />
    </input>-<input type="text" id="htqx1" name="htqx1" class="easyui-datebox medium bLeft" value="{$vo.htqx1|toDate='Y-m-d'}" />
    </input></td>
  <td class="tRight" >食用油：</td>
	<td class="tLeft" >{$vo.syy|getAqInfo='syy',1}</td>
    <td class="tLeft">[<a href="#" id="a_syy_d" f="syy_d" s="食用油使用详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >食堂面积：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="stmj" value="{$vo.stmj}" title="食堂总面积" />
    平方米</td>
  <td class="tLeft">[<a href="#" id="a_stmj_d" f="stmj_d" s="台风引发空飘物">详细</a>]</td>
	<td class="tRight" >食盐：</td>
	<td class="tLeft" >{$vo.sy|getAqInfo='sy',1}</td>
    <td class="tLeft">[<a href="#" id="a_sy_d" f="sy_d" s="食盐使用详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >设备估价：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="sbgj" value="{$vo.sbgj}" title="食堂设备估价" />
    元</td>
  <td class="tLeft"></td>
	<td class="tRight" >各类辅料：</td>
	<td class="tLeft" >{$vo.glfl|getAqInfo='glfl',1}</td>
    <td class="tLeft">[<a href="#" id="a_glfl_d" f="glfl_d" s="各类辅料的使用详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >设备折旧：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="sbzj" value="{$vo.sbzj}" title="食堂设备折旧" />
    元</td>
  <td class="tLeft"></td>
	<td class="tRight" >水产肉类：</td>
	<td class="tLeft" >{$vo.scrl|getAqInfo='scrl',1}</td>
    <td class="tLeft">[<a href="#" id="a_scrl_d" f="scrl_d" s="水产肉类的详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >餐厅面积：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="ctmj" value="{$vo.ctmj}" title="餐厅面积" />
    平方米</td>
  <td class="tLeft"></td>
	<td class="tRight" >蔬菜：</td>
	<td class="tLeft" >{$vo.sc|getAqInfo='sc',1}</td>
    <td class="tLeft">[<a href="#" id="a_sc_d" f="sc_d" s="蔬菜的详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >固定餐位数：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="gdcws" value="{$vo.gdcws}" title="固定餐位数" />
    个</td>
  <td class="tLeft">[<a href="#" id="a_gdcws_d" f="gdcws_d" s="固定餐位数的详细情况">详细</a>]</td>
	<td class="tRight" >餐具消毒：</td>
	<td class="tLeft" >{$vo.cjxd|getAqInfo='cjxd',1}</td>
    <td class="tLeft">[<a href="#" id="a_cjxd_d" f="cjxd_d" s="餐具消毒的详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >就餐学生数[早]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jcxss1" value="{$vo.jcxss1}" title="早餐就餐学生数" />
    个</td>
  <td class="tLeft"></td>
	<td class="tRight" >食品留样：</td>
	<td class="tLeft" >{$vo.sply|getAqInfo='sply',1}</td>
    <td class="tLeft">[<a href="#" id="a_sply_d" f="sply_d" s="食品留样的详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >[中]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jcxss2" value="{$vo.jcxss2}" title="中餐就餐学生数" />
    个</td>
  <td class="tLeft"></td>
	<td class="tRight" >制度管理：</td>
	<td class="tLeft" >{$vo.zdgl|getAqInfo='zdgl',1}</td>
    <td class="tLeft">[<a href="#" id="a_zdgl_d" f="zdgl_d" s="制度管理详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >[晚]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jcxss3" value="{$vo.jcxss3}" title="晚餐就餐学生数" />
    个</td>
  <td class="tLeft"></td>
  <td class="tRight" >环境卫生：</td>
	<td class="tLeft" >{$vo.hjws|getAqInfo='hjws',1}</td>
    <td class="tLeft">[<a href="#" id="a_hjws_d" f="hjws_d" s="食品留样的详细情况">详细</a>]</td>
</tr>
<tr>
  <td class="tRight" >学生标准[早]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jcxsbz1" value="{$vo.jcxsbz1}" title="就餐学生早餐标准" />
    元</td>
  <td class="tLeft"></td>
  <td class="tRight" >&nbsp;</td>
	<td class="tLeft" >&nbsp;</td>
    <td class="tLeft">&nbsp;</td>
</tr>
<tr>
  <td class="tRight" >[中/晚]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jcxsbz2" value="{$vo.jcxsbz2}" title="就餐学生中晚餐标准" />
    元</td>
  <td class="tLeft"></td>
	<td class="tRight" >&nbsp;</td>
	<td class="tLeft" >&nbsp;</td>
    <td class="tLeft">&nbsp;</td>
</tr>
<tr>
  <td class="tRight" >就餐职工数[早]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jczgs1" value="{$vo.jczgs1}" title="早餐就餐学生数" />
    个</td>
  <td class="tLeft"></td>
  <td class="tRight" >职工标准[早]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jczgbz1" value="{$vo.jczgbz1}" title="就餐学生早餐标准" />
    元</td>
	<td class="tLeft">&nbsp;</td>
</tr>
<tr>
  <td class="tRight" >[中]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jczgs2" value="{$vo.jczgs2}" title="中餐就餐学生数" />
    个</td>
  <td class="tLeft"></td>
  <td class="tRight" >[中/晚]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jczgbz2" value="{$vo.jczgbz2}" title="就餐学生中晚餐标准" />
    元</td>
	<td class="tLeft">&nbsp;</td>
</tr>
<tr>
  <td class="tRight" >[晚]：</td>
  <td class="tLeft" ><input type="number" class="medium bLeft" name="jczgs3" value="{$vo.jczgs3}" title="晚餐就餐学生数" />
    个</td>
  <td class="tLeft"></td>
  <td class="tRight" >备注信息：</td>
	<td class="tLeft" ><a href="#" id="a_remarks" f="remarks" s="备注信息">点击查看/修改备注信息</a><br />(主要用于记录历次经营情况)</td>
    <td class="tLeft">&nbsp;</td>
</tr>


<tr>
	<td colspan="7" align="center"><input type="hidden" name="dwid" value="{$vo.dwid}" >
	  <input type="hidden" name="ajax" value="1">
	  <input type="button" value="保 存" onclick="save()" class="small submit">
	  <!--<input type="reset" class="submit small" value="清 空" >--></td>
	</tr>
</table>
</form>
</div>
</div>
<style>
.dlg{ height:520px; width:930px; top:2px; position:static; float:left;}
.dlg1{ height:500px; width:910px; float:left;}
</style>
<div class="hide" style="height:100%" id="hideDiv">
	<div id="dlg_remarks" class="dlg"><div id="div_remarks" class="dlg1">{$vo.remarks}</div></div>
    
    <div id="dlg_jydw_d" class="dlg"><div id="div_jydw_d" class="dlg1" f='jydw_d'>{$vo.jydw_d}</div></div>
	<div id="dlg_stmj_d" class="dlg"><div id="div_stmj_d" class="dlg1" f='stmj_d'>{$vo.stmj_d}</div></div>
	<div id="dlg_gdcws_d" class="dlg"><div id="div_gdcws_d" class="dlg1" f='gdcws_d'>{$vo.gdcws_d}</div></div>
	<div id="dlg_cfxf_d" class="dlg"><div id="div_cfxf_d" class="dlg1" f='cfxf_d'>{$vo.cfxf_d}</div></div>
	<div id="dlg_rlfs_d" class="dlg"><div id="div_rlfs_d" class="dlg1" f='rlfs_d'>{$vo.rlfs_d}</div></div>
	<div id="dlg_syy_d" class="dlg"><div id="div_syy_d" class="dlg1" f='syy_d'>{$vo.syy_d}</div></div>
	<div id="dlg_sy_d" class="dlg"><div id="div_sy_d" class="dlg1" f='sy_d'>{$vo.sy_d}</div></div>
	<div id="dlg_glfl_d" class="dlg"><div id="div_glfl_d" class="dlg1" f='glfl_d'>{$vo.glfl_d}</div></div>
	<div id="dlg_scrl_d" class="dlg"><div id="div_scrl_d" class="dlg1" f='scrl_d'>{$vo.scrl_d}</div></div>
	<div id="dlg_sc_d" class="dlg"><div id="div_sc_d" class="dlg1" f='sc_d'>{$vo.sc_d}</div></div>
	<div id="dlg_cjxd_d" class="dlg"><div id="div_cjxd_d" class="dlg1" f='cjxd_d'>{$vo.cjxd_d}</div></div>
	<div id="dlg_sply_d" class="dlg"><div id="div_sply_d" class="dlg1" f='sply_d'>{$vo.sply_d}</div></div>
	<div id="dlg_zdgl_d" class="dlg"><div id="div_zdgl_d" class="dlg1" f='zdgl_d'>{$vo.zdgl_d}</div></div>
	<div id="dlg_hjws_d" class="dlg"><div id="div_hjws_d" class="dlg1" f='hjws_d'>{$vo.hjws_d}</div></div>
	
    <div id="tempDiv"></div>
</div>
<include file="Public:footer" />
<script>
jQuery(function(){
	$("#a_jydw_d,#a_stmj_d,#a_gdcws_d,#a_cfxf_d,#a_rlfs_d,#a_syy_d,#a_sy_d,#a_glfl_d,#a_scrl_d,#a_sc_d,#a_cjxd_d,#a_sply_d,#a_zdgl_d,#a_hjws_d,#a_remarks").click(function(){
		var ff = $(this).attr("f");//f用于表示操作的字段，
		var sf = $(this).attr("s");//s用于显示的标题
		$('#dlg_'+ff).unbind().dialog({
			onOpen:function(){
				$('html').addClass('hidescroll');},
			onClose:function(){
				$('html').removeClass('hidescroll');
				if(editor){ 
					$('#div_'+ff).html(editor.html());
					editor.remove();
					editor = null;
					window.location.reload();
				}
			},
			modal:true,title:sf+"使用详情查看修改对话框(双击进入编辑状态)",width:windowW,height:windowH,maximizable:true,resizable:true,
			buttons:[{
				text:'保存',iconCls:'icon-ok',
				handler:function(){
					if(!editor){ $('#dlg_'+ff).dialog('close');return;}
					var dwid 	= '{$Think.get.id}';
					$('#'+ff).html(editor.html());	
					var o		= {};//动态参数
					o[ff]		= editor.html();
					o['dwid']	= dwid;
					$.post("__URL__/update/",o,function(data){
						$.messager.show({title:'提示信息',msg:data.info,timeout:2000,showType:'slide'});
						if(data.status){ $('#dlg_'+ff).dialog('close');}
					}//function
					,"json");//post	
				}
			},{
				text:'关闭',handler:function(){
					$('#dlg_'+ff).dialog('close');
				}
			}]
		});	
		//不足5个字符时直接显示编辑器
		if($('#div_'+ff).html().length<5){
			editor = showEditor(ff,0,495);
		}else{
			jQuery('#dlg_'+ff).one('dblclick',function(){
				editor = showEditor(ff,0,495);
			})
		}
	})//click
	
	//查找详情里面的图片，并加个链接a标签，用于fancybox的图片集浏览	
	var aImg = $('#hideDiv img');
	var ff1 = "";//用于区分图片组的rel
	var temp= "";//用于临时记录上一次的rel，如果相同则不再添加节点
	aImg.each(function(i){
		ff1 = $(this).closest('.dlg1').attr('f');
		src = this.src;title = this.title;
		if(!$(this).parent().is('a')){
			if(temp!=ff1)
				$('#a_'+ff1).after("&nbsp;&nbsp;&nbsp;<a href='#' class='aGallay' title='"+ title +"' f='"+ff1+"'>图</a>");
			//$(this).wrap("<a href='"+ src +"' class='iGallay' rel='"+ ff1 +"' title='"+ title +"'></a>");
		}
		temp = ff1;
	})//each
	
	//给‘图‘a标签加个点击函数
	$('.aGallay').click(function(){
		f	= $(this).attr('f');
		$('#tempDiv').html($('#div_'+f).html());
		$('#tempDiv img').each(function(i){
			ff1 = $(this).closest('.dlg1').attr('f');
			src = this.src;title = this.title;
			if(!$(this).parent().is('a')){
				$(this).wrap("<a href='"+ src +"' class='iGallay' rel='"+ ff1 +"' title='"+ title +"'></a>");
			}
		})//each
		a = $('#tempDiv a').detach();	//将a标签从tempdiv中取出
		i = $('#tempDiv img').detach();	//将img标签从tempdiv中取出
		t	= $('#tempDiv').html();	//在tempdiv中只有text了！将t作为标题放入fancybox中
		$.fancybox( a ,{minWidth:'700px',autoSize:true,fitToView:true,openEffect:'fade',loop:false,
			helpers:{title:{type:'inside' }},
			afterLoad : function() {
					this.title = '[图片 ' + (this.index + 1) + ' of ' + this.group.length + ' ] ' +(this.title ? this.title: '') +'<br>'+t;
			}//function
		});	//fancybox
	})//click
	/////////////////////////////////////////////////////////////////////////////////////////
	//$("#form2").validator();
})//jquery
 
function save(){
    var inputs = $("#form2 :input").validator({ lang: 'zh',position: 'right left',offset: [-12, 0],message: '<div><em/></div>' });//不用检测表单
    if(inputs.data("validator").checkValidity()){
		var queryString = $('#form2').serialize();
		$.post('__URL__/update/',queryString,function(data){
			$.messager.show({
				title:'提示信息',msg:data.info,timeout:2000,showType:'slide'
			});
		},'json')	
	}	
}
</script>